package com.ruoyi.project.wx.carInfo.service;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import com.ruoyi.project.wx.carInfo.domain.CarInfo;
import com.ruoyi.project.wx.carInfo.mapper.CarInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("carInfoService")
public class CarInfoServiceImpl implements CarInfoService {

    @Autowired
    private CarInfoMapper carInfoMapper;

    @Override
    public int insert(CarInfo carInfo) {
        return carInfoMapper.insert(carInfo);
    }

    @Override
    public int update(CarInfo carInfo) {
        return carInfoMapper.update(carInfo);
    }

    @Override
    public int delCarInfoByIds(String ids) {
        return carInfoMapper.delCarInfoByIds(Convert.toStrArray(ids));
    }

    @Override
    @DataScope(tableAlias = "w")
    public List<CarInfo> carInfolist(CarInfo carInfo) {
        return carInfoMapper.carInfolist(carInfo);
    }

    @Override
    @DataScope(tableAlias = "w")
    public CarInfo selectCarInfoById(Long id) {
        return carInfoMapper.selectCarInfoById(id);
    }
}
